package com.phantasy.ui.style
{
	import flash.display.BitmapData;
	import flash.utils.Dictionary;
	/**
	 *位图数据池 
	 * @author Administrator
	 * 
	 */	
	public class BitmapDataPool
	{
		private static var instance:BitmapDataPool;
		
		private var pool:Dictionary;
		public function BitmapDataPool()
		{
			this.pool = new Dictionary();
		}
		
		public static function getInstance():BitmapDataPool
		{
			if (instance == null)
			{
				instance = new BitmapDataPool();
			}
			return instance;
		}
		
		
		public function dispose(_arg1:String, _arg2:String):void
		{
			var _local3:BitmapData = this.pool[((_arg1 + "_") + _arg2)];
			if (_local3)
			{
				_local3.dispose();
				_local3 = null;
				delete this.pool[((_arg1 + "_") + _arg2)];
			}
		}
		
		public function getBitmapData(_arg1:String, _arg2:String):BitmapData
		{
			if ((((_arg1 == "")) || ((_arg1 == null))))
			{
				return (null);
			}
			var _local3:BitmapData = this.pool[((_arg1 + "_") + _arg2)];
			return (_local3);
		}
		
		public function addBitmapData(_arg1:String, _arg2:String, _arg3:BitmapData):void
		{
			this.pool[((_arg1 + "_") + _arg2)] = _arg3;
		}

	}
}